/*
 * Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Description: zdiag pkt
 * This file should be changed only infrequently and with great care.
 */

#include "zdiag_pkt.h"
#include "zdiag_adapt_layer.h"
ext_errno zdiag_check_mux_pkt(msp_mux_packet_head_stru *mux, td_u16 size)
{
    td_u16 crc_val;
    uapi_unused(size);
    if (mux->start_flag != MUX_START_FLAG) {
        return EXT_ERR_FAILURE;
    }

    crc_val = diag_adapt_crc16(0, mux->puc_packet_data, mux->packet_data_size);
    if (crc_val != mux->crc16) {
        return EXT_ERR_FAILURE;
    }
    return EXT_ERR_SUCCESS;
}

ext_errno zdiag_check_hcc_pkt(td_u8 *data, td_u16 size)
{
    uapi_unused(data);
    uapi_unused(size);

    return EXT_ERR_SUCCESS;
}
